package collectors;

import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

/**
 * @program: my-springboot-completely
 * @description:
 * @author: 按时吃药
 * @create: 2023/06/08 16:13
 */
public class OptionalTest {

    public static void main(String[] args) {

        System.out.println("Student.Fields.gradeType = " + Student.Fields.gradeType);

        StudentList.list.stream().map(student -> {
            Optional<Student> st = Optional.of(student);
            String s1 = st.filter(s -> s.getName().equals("5"))
                    .map(Student::getName)
                    .get();
            return s1;
        }).collect(Collectors.toList()).forEach(System.out::println);



    }
}
